<?php
global $id,$page,$pagesize;

$id = isset($_REQUEST['id']) ? trim($_REQUEST['id']): '';
$table = 'juese';
$pagesize = 20;
$juese = new Juese();
switch ($act){
	case 'manage' :
		$mng = $juese->manage();
		break;
		
		
	case 'add' :
		if ($submit){
			$data = $_POST['data'];
			$sql = "SELECT * FROM $juese->table WHERE TITLE = '$data[title]'";
			$_juese = $juese->db->select($sql);
			if ($_juese){
				showmessage('角色已经存在！','');
			}
			$juese->db->insert($juese->table, $data);
			showmessage('添加成功！','?mod=juese');
		}else{
			$add = Array("title" =>'' ,"yuqi" =>'' ,"uid" =>3031283052 ,"time" =>time() ,"count" =>'' ,"type" =>'',"ispass" => 1);
			break;
		}
		
		
	case 'edit' :
		if ($submit){
			$data = $_POST['data'];
			$juese->db->update($juese->table, $data);
			showmessage('修改成功！','?mod=juese');
		}else{
			$edit = $juese->edit();
			break;
		}
		
		
	case 'del' :
		$del = $juese->del();
		showmessage('删除成功！','?mod=juese');
		break;
}

include admintpl($mod.'.'.$act);
?>